Attacks on software often exploit memory errors, such as buffer overflows, to crash programs or to gain control over the execution of a program. This is a serious problem because a large proportion of software vulnerabilities are memory errors. Techniques have been developed to protect against such attacks, however despite this at least 40% of the vulnerabilities published by US Computer Emergency Readiness Team (US-CERT) in the last six months are memory errors.
Safe languages (e.g. Java and C#) include checks to ensure type safety and they throw exceptions when the checks fail; however unsafe languages (e.g. C and C++) are particularly vulnerable. Checks can be added transparently to programs written in unsafe languages; however, existing techniques are impractical because they have high overhead or require non-trivial changes to the source code or the language runtime.
The embodiments described below are not limited to implementations which solve any or all of the disadvantages of known methods of detecting errors and preventing attacks.